<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<script type="text/javascript" src="<%=basePath%>backgroundManager/js/airliftPriceManage.js"></script>
<form id="pagerForm" method="post" action="<%=basePath%>airliftPrice_findAirliftPricesM.action"> <!-- 此action指定的是排序、分页所提交的action <%=basePath%>price_secondFindPrices.action-->
	<input type="hidden" name="status" value="${param.status}"/>
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum" value="${requestScope.pageNum}" />
	<input type="hidden" name="numPerPage" value="${model.numPerPage}" />
	<input type="hidden" name="orderField" value="${param.orderField}" />
	<input type="hidden" name="orderDirection" value="${param.orderDirection}" />
	<!-- 存放查询条件 -->
	<input name="priceSeachBean.channelName" type="hidden" value="${requestScope.priceSeachBean.channelName}" />
	<input name="priceSeachBean.startPartitionNumber" type="hidden" value="${requestScope.priceSeachBean.startPartitionNumber}" />
	<input name="priceSeachBean.startDate" type="hidden" value="${requestScope.priceSeachBean.startDate}" />
	<input name="priceSeachBean.endDate" type="hidden" value="${requestScope.priceSeachBean.endDate}" />
	<input name="priceSeachBean.status" type="hidden" value="${requestScope.priceSeachBean.status}" />
	<input name="priceSeachBean.classNum" type="hidden" value="${requestScope.priceSeachBean.classNum}" />
</form>


<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="<%=basePath%>airliftPrice_findAirliftPricesM.action?numPerPage=10&pageNum=1&orderField=P_PRICE_ID&orderDirection=asc" method="post">
	<div class="searchBar">
				<div class="pageFormContent1">
					<p>
					<label width="50">渠道名称：</label>
					<input id="channelName_ma_air" name="priceSeachBean.channelName" type="text" size="13" value="${requestScope.priceSeachBean.channelName}" />
					<input id="seachChannelBtn_ma_air" type="button" value="..." />
					</p>
					<p>
				    <label>价格名称：</label>
					<input type="text" name="priceSeachBean.startPartitionNumber" value="${requestScope.priceSeachBean.startPartitionNumber}" />
					</p>
					<p>
					<label>有效日期起：</label>
					<input type="text" value="<fmt:formatDate value="${requestScope.priceSeachBean.startDate}" type="date" dateStyle="long"/>" name="priceSeachBean.startDate" class="date" format="yyyy年MM月dd日" yearstart="-5" yearend="5" readonly />
					</p>
					<p>
					<label>有效日期止：</label>
					<input type="text" value="<fmt:formatDate value="${requestScope.priceSeachBean.endDate}" type="date" dateStyle="long"/>" name="priceSeachBean.endDate" class="date" format="yyyy年MM月dd日" yearstart="-5" yearend="5" readonly />
					</p>
					<p>
					<label>是否审批：</label>
					<select id=status_ma_air name="priceSeachBean.status" class="combox">
					<option value="" selected>全部</option>
					<option value="NE">已审批</option>
					<option value="CL">未审批</option>
					</select>
					</p>
					<p>
						<label>请选择:</label>
						<input type="radio" name="abop" checked="checked" value="true" />客户类别
						<input type="radio" name="abop" value="false" />客户
					</p>
					<p>
						<span id="seach_type_clientType_ma">
						<label>客户类别:</label>
						<select id="clientType_select_ma">
						<option value="" selected>全部</option>
						<c:forEach items="${sessionScope.clientClasses}" var="clientClass">
						<option value="${clientClass.classNumber}">${clientClass.className}</option>
						</c:forEach>
						</select>
						</span>
						<span id="seach_type_client_ma">
						<label>客户:</label>
						<input type="text" id="client_ma_air" readonly="readonly" size="13" name="clientName" />
						<input type="button" id="clientSeachBtn_ma_air" value="..." />
						<input type="hidden" name="priceSeachBean.classNum" value="${requestScope.priceSeachBean.classNum}"/><!-- 选择客户类型后,保存到这 -->
						</span>
					</p>
				</div>
		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">&nbsp;&nbsp;&nbsp;查&nbsp;&nbsp;询&nbsp;&nbsp;&nbsp;</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="<%=basePath%>airliftPrice_readAddAirlifitPrice.action" target="navTab" title="添加价格" rel="addAirliftPrice"><span>添加价格</span></a></li>
			<li><a class="delete" href="<%=basePath%>airliftPrice_delAirliftPrice.action" posttype="string" rel="ids" target="selectedTodo" title="确定要删除吗?"><span>删除价格</span></a></li>
			<li><a class="edit" href="<%=basePath%>airliftPrice_previewPrices.action?priceID={sid_user}" target="navTab" rel="lookPrice"><span>查看报价</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="194">
		<thead>
			<tr>
				<th width="30"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				<th width="120" orderField="P_CHANNEL_NAME" class="${requestScope.orderDirection}">渠道名称</th>
				<th width="100" orderField="P_PARTITION_NUMBER" class="${requestScope.orderDirection}">价格名称</th>
				<th width="80"orderField="CLASS_NUMBER" class="${requestScope.orderDirection}">客户/客户类别</th>
				<th width="80"orderField="P_PRICE_START_DATE" class="${requestScope.orderDirection}">有效时间起</th>
				<th width="80"orderField="P_PRICE_END_DATE" class="${requestScope.orderDirection}">有效时间止</th>
				<th width="80"orderField="PRICE_STAFF_NUMBER" class="${requestScope.orderDirection}">操作人</th>
				<th width="60"orderField="P_PRICE_STATUS" class="${requestScope.orderDirection}">是否审批</th>
				<th width="80"orderField="PRICE_STAFF_NUMBERS" class="${requestScope.orderDirection}">审批人</th>
				<th width="80"orderField="P_PRICE_APPROVAL_DATE" class="${requestScope.orderDirection}">审批日期</th>
				<th width="190">说明</th>
				<th width="80"orderField="P_PRICE_ADD_DATE" class="${requestScope.orderDirection}">添加日期</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${requestScope.priceList}" var="price" varStatus="n">
			<tr target="sid_user" rel="${price.priceID}">
				<td><input name="ids" value="${price.priceID}" type="checkbox"></td>
				<td>${price.channelName}</td>
				<td>${price.startPartitionName}</td>
				<td>${price.clientClassName}</td>
				<td>${price.startDate}</td>
				<td>${price.endDate}</td>
				<td>${price.handelStaff}</td>
				<td><c:if test="${price.status eq 'NE'}">已审批</c:if><c:if test="${price.status eq 'CL'}">未审批</c:if> </td>
				<td>${price.approvalStaff}</td>
				<td>${price.approvalDate}</td>
				<td>${price.note}</td>
				<td>${price.addDate}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select id="countSelect" class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})"  >
				<option value="10">10</option>
				<%--<option value="50">50</option>	
				<option value="100">100</option>
			--%></select>
			<span>条，共${requestScope.totalRecords}条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="${requestScope.totalRecords}" numPerPage="${requestScope.pageSize}" pageNumShown="${requestScope.totalPages}" currentPage="${requestScope.pageNum }"></div>

	</div>
</div>
<script type="text/javascript">
(function(){
	var abops = document.getElementsByName("abop");
	$("#status_ma_air").attr("value","${requestScope.priceSeachBean.status}")
	if("${requestScope.abop}" == "true" || "${requestScope.abop}"==""){
		$("#seach_type_clientType_ma").show("slow");
		$("#seach_type_client_ma").hide();
		$("#clientType_select_ma").attr("value","${requestScope.priceSeachBean.classNum}");
		abops[0].checked = true;
	}else{
		$("#client_ma_air").attr("value","${requestScope.clientName}");
		$("#seach_type_client_ma").show("slow");
		$("#seach_type_clientType_ma").hide();
		abops[1].checked = true;
	}
})();
</script>